﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;

namespace MusicPlayerPlus.PlugIn.DownloadMusic
{
    public class DownloadData
    {
        public static ObservableCollection<Model.DownloadMusicItem> downloadTrackList = new ObservableCollection<Model.DownloadMusicItem>();
        public static Dictionary<Guid, Model.DownloadMusicItem> downloadDic = new Dictionary<Guid, Model.DownloadMusicItem>();

        public static void Clear()
        {
            downloadTrackList.Clear();
            downloadDic.Clear();
        }

        public static void Add(Model.DownloadMusicItem track)
        {
            if (!downloadDic.ContainsKey(track.ID))
            {
                downloadTrackList.Add(track);
                downloadDic.Add(track.ID, track);
                track.Download();
            }
        }
    }
}
